package com.hspedu.homework;

/**
 * @author DL5O
 * @version 1.0
 */
public class Homework07 {
    public static void main(String[] args) {
        Car car = new Car(41);
//        Car.Air air =car.new Air();
        Car.Air air = car.getAirInstance();
        System.out.println("温度:"+car.getTemperature());
        air.flow();

        System.out.println("=======");
        car.setTemperature(-1);
        System.out.println("温度:"+car.getTemperature());
        air.flow();
    }
}

class Car{
    private double temperature;

    public Car(double temperature) {
        this.temperature = temperature;
    }

    public double getTemperature() {
        return temperature;
    }

    public void setTemperature(double temperature) {
        this.temperature = temperature;
    }

    class Air{
        public void flow(){
            System.out.println("吹风功能开启..");
            if(temperature>40.0){
                System.out.println("吹冷气");
            }

            if(temperature<0){
                System.out.println("吹暖气");
            }
        }
    }

    public Air getAirInstance(){
        return new Air();
    }
}